feat(mexp): Onboarding Modelexperiments#1547
Conversation
|
This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it. |
| labels = { | ||
| label = "Example label" | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Please add import examples as well please.
Note: There is (since yesterday) a separate file which contains an import example which is handled by the terraform doc generation (e.g. have a look at the import-by-string.id.tf files in the examples folders).
| @@ -0,0 +1,13 @@ | |||
| AI Model Experiment Instance Resource schema. | |||
There was a problem hiding this comment.
This description.md doubles the ##Example Usage in the resulting doc.
| // Schema defines the schema for the resource. | ||
| func (i *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { | ||
| resp.Schema = schema.Schema{ | ||
| Description: markdownDescription, |
There was a problem hiding this comment.
Here the main description should be present instead of a doubled ##Example Usage
| @@ -0,0 +1,604 @@ | |||
| package instance | |||
| @@ -0,0 +1,21 @@ | |||
| AI Model Experiment Instance Token Resource schema. | |||
There was a problem hiding this comment.
same here: results in a doubled ##Example Usage
| TOKENSTATE_INACTIVE = "inactive" | ||
| ) | ||
|
|
||
| //go:generate mockgen -destination=./mock/serviceenablement.go -package=mock_serviceenablement github.com/stackitcloud/stackit-sdk-go/services/serviceenablement/v2api DefaultAPI |
| func inputInstanceConfig(instanceName, instanceDescription, token_name, token_description string) string { | ||
| return fmt.Sprintf(` | ||
| %s | ||
|
|
There was a problem hiding this comment.
We are using a different structure here (e.g. have a look at dremio testdata folder):
- tf files include the configuration
- in the acc_test.go the config values are set
- there is a min and a max test (min = all required parameters/fields are set, max = all are set to one possible value)
| resource.TestCheckResourceAttrSet("stackit_modelexperiments_token.token", "token"), | ||
| resource.TestCheckResourceAttrSet("stackit_modelexperiments_token.token", "valid_until"), | ||
| ), | ||
| }, |
There was a problem hiding this comment.
datasource test and import test missing
| model.State = types.StringValue(string(waitResp.Token.State)) | ||
| } | ||
|
|
||
| mapValue, diags := types.MapValueFrom(ctx, types.StringType, token.Labels) |
There was a problem hiding this comment.
There is a MapLabels() function in the utils package
| return fmt.Errorf("instance id not present") | ||
| } | ||
|
|
||
| mapValue, diags := types.MapValueFrom(ctx, types.StringType, instance.Labels) |
There was a problem hiding this comment.
There is a MapLabels() function in the utils package
Description
This is the onboarding PR for integration STACKIT Modelexperiments into the STACKIT Terraform Provider.
It adds for customer the ability to:
Checklist
make fmtexamples/directory)make generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)